<?php

namespace app\api\controller;

use app\admin\logic\system\SystemAttachmentLogic;
use app\common\basic\BaseController;
use support\Request;
use Webman\Http\Response;

class UploadController extends BaseController
{
    public function imageUpload(Request $request)
    {
        $logic = new SystemAttachmentLogic();
        $type = $request->input('mode', 'system');
        if ($type == 'local') {
            return $this->success($logic->uploadBase('image', true));
        }
        return $this->success($logic->uploadBase('image'));
    }

    public function filesUpload(Request $request)
    {
        $logic = new SystemAttachmentLogic();
        $type = $request->input('mode', 'system');
        if ($type == 'local') {
            return $this->success($logic->uploadBase('file', true));
        }
        return $this->success($logic->uploadBase('file'));
    }
}